package com.qf.cx.simplenms.persist.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.qf.cx.simplenms.persist.dao.api.TagMemoryDao;
import com.qf.cx.simplenms.persist.entity.TagMemoryEntity;
import com.qf.cx.simplenms.persist.service.api.TagMemoryService;

@Service
@Transactional(value = "hibernateTransactionManager")
public class TagMemoryServiceImpl implements TagMemoryService {
	@Autowired
	private TagMemoryDao tagMemoryDao;

	@Override
	public void addTagMemory(TagMemoryEntity tagMemory) {
		tagMemoryDao.addTagMemory(tagMemory);
	}

	@Override
	public void deleteTagMemory(String name) {
		tagMemoryDao.deleteTagMemory(name);
	}

	@Override
	public void updateTagMemory(TagMemoryEntity tagMemory) {
		tagMemoryDao.updateTagMemory(tagMemory);
	}

	@Override
	public TagMemoryEntity getTagMemory(String name) {
		return tagMemoryDao.getTagMemory(name);
	}

	@Override
	public List<TagMemoryEntity> getTagMemorys() {
		List<TagMemoryEntity> list = tagMemoryDao.getTagMemorys();
		return list;
	}

	@Override
	public void addTagMemoryies(List<TagMemoryEntity> tagMemoryEntities) {
		tagMemoryEntities.forEach(t -> tagMemoryDao.addTagMemory(t));
	}

}
